﻿Public Class FormBajaUsuario

    Private _miCampeonato As Campeonato
    Private _idUsuarioAEliminar As Integer

    Property idUsuarioAEliminar As Integer
        Get
            Return Me._idUsuarioAEliminar
        End Get
        Set(value As Integer)
            Me._idUsuarioAEliminar = value
        End Set
    End Property

    Private Sub FormBajaUsuario_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.MdiParent = FormEntrada
        Me._miCampeonato = New Campeonato
    End Sub

    Private Sub btnBajaUsuario_Click(sender As Object, e As EventArgs) Handles btnBajaUsuario.Click
        Dim campoRelleno As Boolean = False
        If tbxUsuarioBajaNIF.Text.Length = 0 Then
            ErrorProvider1.SetError(tbxUsuarioBajaNIF, "Los campos no pueden estar vacios")
        Else
            ErrorProvider1.SetError(tbxUsuarioBajaNIF, Nothing)
            campoRelleno = True
        End If
        If campoRelleno = True Then
            Me._miCampeonato.eliminarUsuario(Me._idUsuarioAEliminar)
        End If
    End Sub

    Private Sub BtnBuscarUsuarios_Click(sender As Object, e As EventArgs) Handles BtnBuscarUsuarios.Click
        FormBuscarUsuario.Show()
        FormBuscarUsuario.formDestino = "FormBajaUsuario"
    End Sub

    

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Close()
    End Sub

End Class